<?php
$objXajax->registerFunction('frmupdatehotel_loadGrid');
$objXajax->registerFunction('frmupdatehotel_save');

function frmupdatehotel_loadGrid(){ 
    global $objDbSelect,$lang,$path;
    $arrGrid = frmupdatehotel_getGrid();    
    $objResponse = new xajaxResponse();
    $oTbs = new clsTinyButStrong();
    $oTbs->LoadTemplate('../templates/'.$lang.'/'.$path.'/main_updatehotel_grid.html');
    $oTbs->MergeBlock('blk_data', $arrGrid);
    $oTbs->Show(TBS_NOTHING);
    $objResponse->addAssign('frmupdatehotel_divGrid', 'innerHTML', $oTbs->Source);
    $objResponse->addScriptCall("dataTableObj.CreatDataTable('frmupdatehotel_tbl');");                              
    return $objResponse->getXML(); 
 
}
function frmupdatehotel_getGrid($user_id=''){
    global $objDbSelect;
    $user_id = $user_id==''?$_SESSION['current']['user_id']:$user_id;
    $sqlSelect = "SELECT h.*,ht.name as levelname,p.name as pakagename , if(datediff(h.last_chagre_date,now())=0,1,0) as flgnewupdate FROM tbl_service as h join tbl_service_type as ht on h.`level` = ht.id
join tbl_pakage as p on h.pakage_id = p.id where h.user_created = '$user_id' ";
    return $objDbSelect->GetArray($sqlSelect);  
}

function frmupdatehotel_saveUpdate($strId,$month){
    
}

?>
